<?php include template('toper','common');?>
<?php include template('header','common');?>
		<!--导航结束-->
		<!--面包屑-->
		<div class="container crumbs clearfix">
			<p class="fl layout">
				<i class="icon-crumbs"></i>
				<a href="">品牌</a>
				<em>></em>
				{$brand[name]}
			</p>
		</div>
		<!--list-->
		<div class="item-two-column container clearfix">
			<div id="brand-left" class="left fl">
				<div class="layout border border-gray-white brand-info clearfix">
					<div class="item-title">品牌信息</div>
					<div class="layout padding">
						<a class="show" href=""><img src="{$brand['logo']}" width="189" /></a>
						<p class="margin-small-top text-lh" href="">品牌：<a class="text-sub" href="">{$brand['name']}</a></p>
						<p>网址：<span class="text-sub">{$brand['url']}</span></p>
					</div>
				</div>
			</div>
			<div class="fr right goods-list-wrap">
				<!--咨询框-->
				<div class="layout border item-blue-top clearfix">
					<div class="item-title padding-left"><span>品牌介绍</span></div>
					<div class="layout padding">
						<p class="text-lh-small">{$brand['descript']}</p>
					</div>
				</div>
				<!--筛选-->
				<div class="margin-top border border-gray-white item-blue-top filter">
					<dl>
						<dt>排序方式：</dt>
						<dd {if $result['sort'] == 'comper'} class="selected" {/if}><a href="{create_url('sort','comper,')}">综合{if $result['sort'] == 'comper'}<i class="ico-down"></i>{/if}</a></dd>
						<dd {if $result['sort'] == 'sale'} class="selected" {/if}><a href="{create_url('sort','sale,')}">销量{if $result['sort'] == 'sale'}<i class="ico-down"></i>{/if}</a></dd>
						<dd {if $result['sort'] == 'shop_price'} class="selected" {/if}><a href="{create_url('sort','shop_price,'.$result['_by'])}">价格{if $result['sort'] == 'shop_price'}{if $result['_by'] == 'asc'}<i class="ico-down"></i>{else}<i class="ico-up"></i>{/if}{/if}</a></dd>
						<dd {if $result['sort'] == 'hits'} class="selected" {/if}><a href="{create_url('sort','hits,')}">人气{if $result['sort'] == 'hits'}<i class="ico-down"></i>{/if}</a></dd>
						<dd class="filter-page item-page border-none">
							{hd:goods tagfile="goods" method="page" brand_id="$_GET[id]" order="$result[order]" num="20" page="$_GET[page]"}
							{$data['page']}
							{/hd}
						</dd>
					</dl>
				</div>
				<!--商品列表-->
				<div class="list-wrap">
					<ul class="list-h clearfix">
					{hd:goods tagfile="goods" method="lists" brand_id="$_GET[id]" order="$result[order]" num="20" page="$_GET[page]"}
					{loop $data $r}
						<li>
							<div class="lh-wrap">
								<div class="p-img">
									<a href="{url('detail',array('sku_id'=>$r[sku_id]))}"><img src="{thumb($r[thumb],230,230)}" width="230" height="230" /></a>
								</div>
								<div class="p-name">
									<a href="{url('detail',array('sku_id'=>$r[sku_id]))}">{if isset($r['prom_time']) && $r['prom_time'] > 0}<span class="padding-small-left padding-small-right radius-small bg-mix text-white margin-small-right">限时促销</span>{/if}{$r[sku_name]}</a>
								</div>
								<div class="p-price">
									<span class="text-mix">￥<?php echo $r['prom_price']?></span>
								</div>
								<div class="p-hand text-right">
									<div class="short-share">
										{if $r[number] > 0}
										<a class="cart-btn fl" data-event="cart_add" data-skuids="{$r['sku_id']}">加入购物车</a>
										{else}
										<span class="fl">商品已售罄</span>
										{/if}
										{if is_favorite($this->member['id'],$r['sku_id'])}
										<span class="button"><em class="text-gray">已收藏</em></span>
										{else}
										<a class="button collect-btn" data-skuid="{$r['sku_id']}" data-price="{$r['shop_price']}">收藏商品</a>
										{/if}
									</div>
								</div>
							</div>
						</li>
					{/loop}
					{/hd}
					</ul>
				</div>
				<!--分页-->
				<div class="fl layout paging margin-top padding-tb clearfix">
					<?php echo $pages?>
				</div>
			</div>
		</div>
<?php include template('toolbar','common');?>
<?php include template('footer','common');?>	
		<script>
			$(function(){
				//左侧内容
				scrollBar();
				//筛选条
				filterBar();
			})
			
			
			//左侧内容
			function scrollBar(){
				$(window).scroll(function(){
					var doctop = $(document).scrollTop();
					var _head = $("#brand-left").offset().top;
					if(doctop <= _head){
						$('#brand-left').removeClass('scroll-bar');
					}
					if(doctop > _head){
						$('#brand-left').addClass('scroll-bar');
					}
				});
			}
			
			//筛选条
			function filterBar(){
				$(window).scroll(function(){
					var doctop = $(document).scrollTop();
					var _head = $(".list-wrap").offset().top-41;
					if(doctop <= _head){
						$('.goods-list-wrap').removeClass('filter-bar');
					}
					if(doctop > _head){
						$('.goods-list-wrap').addClass('filter-bar');
					}
				});
			}
		</script>
	</body>
</html>
